home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 3: CDPD 3 / Almathera Ten on Ten - Disc 3: CDPD3.iso / scope / 051-075 / scopedisk51 / wputil / macroeditor / me.doc < prev    next >
Text File  |  1995-03-18  |  21KB  |  423 lines

  1.  
  2.  
  3. In this issue of AMnews...
  4.  
  5. WordPerfect's MacroEditor Means
  6. Escape From Drudgery
  7.  
  8. by Randy Chase and Grant Johnson
  9.  
  10.  
  11.     One of the key words in our relationship with computers is repeat.  While
  12. we tire of repetition quickly, the computer thrives on it.  What is needed
  13. in repetitive situations is some way for you to tell the computer what do
  14. and when -- in short, a macro.
  15.  
  16.     Macros let you condense a series of keyboard activities or mouse moves
  17. into a self-contained package of instructions that can be easily called up
  18. in the future.  When invoked, a macro can guide the program through the
  19. required steps to produce the desired results.
  20.  
  21. Macro Magic
  22.  
  23.     The task at hand need not be large and unwieldy to justify  making a
  24. macro of it.  A small but repetitive task can be effectively controlled by
  25. one, such as changing the directory path to a frequently accessed
  26. sub-directory, or altering the margins in a WordPerfect document to those
  27. you use on a regular basis. 
  28.  
  29.     Something as simple as starting a letter is perhaps one of the most
  30. effective (and practical) utilizations of a macro.  Every time you begin a
  31. letter, yo probably follow the same series of steps.  What margin settings
  32. are required?  What is the date?  What return address (or letterhead) is
  33. needed?  These questions can be answered once in a macro, instead of
  34. tediously repeated every time you write a letter.  Once embodied in a
  35. macro, these frequently repeated tasks can be accomplished with a few
  36. simple keystrokes.
  37.  
  38.     WordPerfect itself supports the creation of macros in the most natural
  39. manner possible -- imitation -- by simply telling the computer to pay
  40. attention while the task is being performed.  Then, when required, it can
  41. repeat that process automatically.
  42.  
  43. Enter Macro Editor
  44.  
  45.     While WordPerfect offers this simple means of defining macros, making
  46. even the smallest changes in them has (until the release of WordPerfect's
  47. Macro Editor in this issue of AMnews) necessitated that you start over from
  48. the top.  That's because WordPerfect's word processing program of the same
  49. name records everything you do when it "records" a macro, mistakes and all. 
  50. If you misspell a word and corrected, every time that macro runs you'll
  51. have to watch it corrected over and over.
  52.  
  53.     Also, should even the slightest modification be needed in order for it to
  54. perform, the entire macro had to be redefined.  In the case of complex
  55. macros, this required starting over from the beginning, slowly and
  56. precisely re-creating the entire macro, without making any errors while
  57. incorporating the desired changes.
  58.  
  59. Inside the Workbench Programs Drawer on the AMnews_1 disk, you'll find a
  60. drawer containing the Macro Editor which is called ME, a number of
  61. supporting files including Help, and eleven pre-programmed macros. 
  62. Although the Macro Editor won't run inside of AMnews due to the absence of
  63. the proprietary WordPerfect file it requires, Figure #1 from Thingies on
  64. the Articles Jazz pull down menu at the top of this screen will show you
  65. what it looks like on Workbench.
  66.  
  67.     The release of Macro Editor provides the solution to this awkward
  68. situation.  By using it, WordPerfect owners can now take those
  69. not-quite-right macros and perfect or adapt them with great precision, not
  70. to mention ease.  This increased flexibility makes using macros within
  71. WordPerfect far more inviting and should encourage you to explore the
  72. untapped potential of creating your own personal command structure.
  73.  
  74. If It's Worth Doing Twice...
  75.     
  76. The secret to streamlining WordPerfect and customizing its daily operation
  77. lies in determining just what can best be done within macros.  If you do
  78. something likely to be repeated again in the future, it might as well be
  79. done the first time with WordPerfect's macro recorder turned on, capturing
  80. the activity in a macro that can then repeat the process whenever needed.
  81.  
  82. With the greatly increased flexibility offered by Macro Editor, more
  83. intricate applications can now be more comfortably mastered, modified and
  84. adapted as needed in the future.  It's no longer necessary to watch
  85. mistakes made and corrected while defining a macro be repeated every time
  86. the macro is invoked.  With the Editor, it is now a simple process to
  87. delete the incorrect command lines and insert new ones in their place.
  88.  
  89. Description of Sample Macros
  90.  
  91. Agreement.mac -  This loads a sample rental contract into WordPerfect, and
  92. allows you to fill in the appropriate information needed.  At its
  93. conclusion, it invokes a second macro, letterhead.mac, that inserts a
  94. simple letterhead at the top of the document.
  95.  
  96. Letterhead.mac -  Used by agreement.mac, this provides a centered business
  97. heading for the rental contract created by agreement.mac.
  98.  
  99. Documentize.mac - This macro, written by WordPerfect's Mike Scalora, will
  100. try to convert a AMiga text file (with hard returns at the end of each
  101. line) into a WordPerfect document (hard returns only at the end of
  102. paragraphs).  To use the Documentize macro, RETRIEVE your text with the
  103. TEXT FILE sub-menu, then execute this macro.  For it to work properly, you
  104. must have a blank line (a line with nothing on it, not even blanks) between
  105. each paragraph.
  106.  
  107. Fancy.LH.mac - This is an example of a macro to begin a letter by placing
  108. the letterhead information at the top of the document, insert the current
  109. date, provide a macro pause letting youinsert the inside address, and then
  110. begin the salutation with "Dear" before returning control.
  111.  
  112. Letter.Close.mac - A companion macro to Fancy.LH.mac, this closes the
  113. letter begun in the preceding macro.
  114.  
  115. Change.Dir.mac - While this is a simple thing, it's a good example of how
  116. common routines can be streamlined by utilizing macros.  This changes the
  117. active path to a sub-directory on df1: named text.  If documents are saved
  118. in various directories on the disk, the tedious process of going through
  119. the requestors to access the desired files can be assumed by the macro
  120. rather than by you.  If used enough, this macro might be more effectively
  121. defined as a one-key macro to further streamline the process.
  122.  
  123. Index.mac - By combining the search and mark-text features within
  124. WordPerfect, this macro facilitates the creation of an index for an
  125. article.  To use this macro, first do a forward search (the F2) for the
  126. word you wish to index.  This search defines for the macro what word it
  127. will be indexing.  When the macro has completed the search and marked all
  128. of the word's appearances in the document, the process can be repeated
  129. until all desired words have been indexed.  Follow the instructions in your
  130. WordPerfect manual for the formal creation of the index itself.
  131.  
  132. Begin.mac - This macro is called up by the Indexing macro to return the
  133. cursor to the beginning of the document before starting the search and mark
  134. operation of the indexing process.
  135.  
  136. PhonePrint.mac - This is a macro for NoteBook (from WordPerfect's Library). 
  137. It opens a file called PhoneBook and prints out a listing of the names and
  138. phone numbers contained there.  Before using it, it will need to be loaded
  139. into Macro Editor and the name of the file to be opened and printed changed
  140. from PhoneBook to the appropriate name requested.
  141.  
  142. MacMover.mac - This is an example of the use of a macro to copy desired
  143. macros from an old data disk to a new one.  It requires a formatted data
  144. disk in drive df0: and the old data disk with the Macs directory in drive
  145. DF1:.  Since the files being copied are selected by typing the file name
  146. rather than clicking on files with the mouse, it will be necessary to use
  147. the editor to insert the names of the proper macros that you wish to
  148. transfer to the new data disk. 
  149.  
  150. Letterhead.mac - This macro creates a simple letterhead and is included as
  151. an example of a chained macro.  The macro Agreement.mac calls this macro
  152. up.  (This chaining of macros also provides an example of the logic and
  153. sequence of execution of chained macros.  Since the initial macro must
  154. complete its full sequence of events before it will surrender control to
  155. the next macro, it is necessary to complete the rental control prior to
  156. summoning the letterhead macro which then returns to the top of the
  157. document and inserts the letterhead at the top of the page.)
  158.  
  159. Amiga D -  This one-key macro reads the date and inserts into the document
  160. at the current cursor location.  As with all one-key macros, it is
  161. necessary that it be located in the root directory on your WordPerfect
  162. disk.
  163.  
  164. Amiga S -  This macro tells WordPerfect to activate the speller and check
  165. the entire document.
  166.  
  167. Amiga W -  This is a simple but often time-saving use of a macro to insert
  168. a frequently typed character string into a document.  In this case the
  169. macro types WordPerfect.
  170.  
  171.     Be cautioned that these sample macros are designed to show some of the
  172. uses of macros, and to provide examples to experiment with using the
  173. Editor.  They all have been created assuming that they will reside on DF1:
  174. in a directory named MACS.  Prior to using them, they should be loaded into
  175. the Editor and modified to indicate where the user has them stored. 
  176. Installing the Editor
  177.     
  178. The WordPerfect Macro Editor contained in this issue of AMnews requires
  179. access to the WP.Library file on your WordPerfect program disk.  It must
  180. therefore be installed on your WordPerfect disk before you can use it. 
  181. This can be done using either the CLI or from WorkBench by dragging the
  182. icons over to your disk.
  183.  
  184.     To properly install the Macro Editor using the CLI, it is necessary to
  185. copy the following files to your WordPerfect program disk:  ME, ME.info,
  186. Help.Me and Help.Me.info.  If you wish to use the sample macros included
  187. with this article, it will also be necessary to move the contents of the
  188. MACS directory to your disk.  Although you can make yours work from
  189. wherever you like, these macros are designed to be used from df1:MACS. 
  190. Should you wish you to locate them elsewhere, they will need to be edited.
  191.  
  192.     If you wish to use the Macro Editor without running WordPerfect, you will
  193. have to put the WP.Library file on the LIBS directory of the Workbench disk
  194. you "boot" your system with.  For those using ARP as an alternative to the
  195. standard AMiga Workbench, the Macro Editor is compatible and will utilize
  196. the appropriate ARP libraries; however, WP.Library must still be present in
  197. the LIBS directory of the active Workbench disk.
  198. Macro Editor Commands and Options
  199.  
  200. OPEN:  loads and existing macro from disk into the editor.
  201.  
  202. SAVE:  saves the macro being edited under same name.
  203.  
  204. SAVE AS:  allows the macro being edited to be saved under a new
  205. name.
  206.  
  207. DELETE:  deletes the high-lighted line in macro currently loaded
  208. in editor.
  209.  
  210. INS KEY:  selects the "Insert Key" mode, which allows keystrokes
  211. to be inserted into a macro.
  212.  
  213. INS ITEM:  provides a list of items (and activities/events) that are
  214. unavailable from the keyboard, but can be inserted into a macro by simply
  215. clicking on the desired item.  Items include macro delays and pauses, mouse
  216. movements, button activity, zoomgadgets, scrolling, and moving and sizing
  217. of windows.
  218.  
  219. EDIT:  the edit menu option allows modification of the five macro items
  220. that have parameters:
  221.  
  222.                 1) Button Up 
  223.                 2) Button Down 
  224.                 3) Mouse Move 
  225.                 4) Window Size/Move 
  226.                 5) Zoom Gadget
  227.  
  228. To edit these items, simply move the cursor to the macro line containing
  229. the event, and with it highlighted, click on the edit key.  A requester
  230. will appear offering prompts for new screen locations to be entered.  For
  231. instance, when editing a move/re-size window command, the editor will
  232. provide a requestor that allows for editing both the X and Y positions, as
  233. well as the width and height of the window.
  234.  
  235. Item/Count:  At the bottom of the Editor screen, the Count number shows the
  236. total number of times a particular line is contained in the macro currently
  237. in the Editor.  The Item number shows the relative number of the currently
  238. highlighted line within the macro being edited.
  239.  
  240. Pull Down Options
  241.  
  242.     The project menu options provide mouse-driven menus to open a macro for
  243. editing, saving, and creating a new CLI.  All options here perform the same
  244. as they do within WordPerfect.
  245.  
  246.     The Type options are used to designate the kind of macro being edited. 
  247. The Editor can be used on macros written for WordPerfect, Notebook and
  248. P-Edit, however it is imperative that you select the proper macro type by
  249. using the pull-down menu and selecting the appropriate setting.  Editing
  250. the wrong macro with the wrong type setting will produce very unpredictable
  251. and undesirable results.
  252.  
  253.     The print options in the menu bar provide for the printing of the macro
  254. currently in the Editor as a text file.  (For an example of the printed
  255. output, see the macro listings that accompany this article.)  The printer
  256. control command turns on the WordPerfect printer control screen.
  257.  
  258.     The help features of the Macro Editor can be accessed either via the help
  259. key or the menu option provided for the mouse.
  260.  
  261.     When in the help mode, pressing any letter on the keyboard will provide
  262. an alphabetical listing of features that start with that letter, along with
  263. the key stroke required to access that option.  That key can then be
  264. pressed to obtain a description of how the feature works.
  265.  
  266. Function Key Commands
  267.  
  268. F1 - Cancel Key:  this key cancels the operation of any function. This key
  269. will also UNDO the last delete if the is no function in progress.
  270.  
  271. F7 - Exit:  exits you from the Macro Editor.  If the macro has been
  272. modified you are asked if you want to save it.  The ARP file requester will
  273. be used if the arp.library is available.
  274.  
  275. F9 - Save:  saves the macro currently in the Editor.  If the file has been
  276. saved previously, it will be saved using the same file name.  If not, a
  277. prompt will appear asking for a file name. In order to save the edited file
  278. under a different name, it is necessary to use the Save As option, accessed
  279. by either clicking on the Save As gadget, or by pressing F10.
  280.  
  281. F10 - Save As:  use the Save As feature to save an edited file under a
  282. different name or using a different directory path.  A prompter will
  283. appear, requesting the desired path and file name prior to saving the
  284. macro.  (The ARP file requester will be used if the arp.library is being
  285. used as an alternative to the standard Amiga Work Bench.)
  286.  
  287. Shift F3 - Switch:  switches control from the Macro Editor macro to
  288. WordPerfect, NoteBook or P-Edit, should one of them be running in the
  289. background.
  290.  
  291. Shift F7 - Print:  prints the macro being edited using the WordPerfect
  292. Print program.
  293.  
  294. Shift F9 - Open:  clears the macro being edited and prompts for the file
  295. name of a new macro to edit.  (Again, the ARP file requester will be used
  296. if the arp.library is being used.)
  297.  
  298. Shift F10 - Retrieve File:  retrieves a macro from disk and copies it into
  299. the Macro Editor window for editing.  The document to be retrieved is
  300. inserted at the current position of the cursor on the screen without
  301. deleting any of the text you might currently be working on.  This command
  302. makes it possible to combine or append macros.
  303.  
  304. Alt F9 - New:  clears the current macro and leaves the Macro Editor window
  305. empty.  If the macro in the editor has been modified since it was last
  306. saved, a requester will ask if the file should be saved before clearing the
  307. work window.
  308.  
  309. Ctrl F1 - New CLI:  opens a new Cli window, while leaving the Editor in the
  310. background.
  311.  
  312. Ctrl F7 - Printer Control:  opens the Printer control panel from Word
  313. Perfect.  Consult your Word Perfect Manual for further instructions.
  314.  
  315. Ctrl F9 - Clear:  clears the current macro and leaves a blank document in
  316. the Editor.  Like the New command, if the resident macro has been modified
  317. since it was last save, a requestor will provide the option to save the
  318. edited version before clearing the Editor.
  319.  
  320. Delete:  deletes the line item highlighted under the cursor and places it
  321. in the undo buffer.  Cancel can then be used to reinsert the item into the
  322. macro. 
  323.  
  324. One Key Macros 
  325.  
  326.     The most effective way to access frequently used macros within
  327. WordPerfect is through the definition of one-key macros.  These are macros
  328. that can be invoked by simply holding down either one of the Amiga keys and
  329. then pressing another key.
  330.      
  331.      When WordPerfect added the use of the standardized keys defined by
  332. Commodore for the AMiga (i.e. Amiga-S saves, Amiga-C copies text etc.) they
  333. also provided for the optional alternative use of these keys.  By changing
  334. the definitions in the Character Mapping screen from AMiga to macro (by
  335. clicking on the first character of the definition and pressing the 1 key)
  336. they can then be defined as one-key macros.
  337.  
  338.     A one-key macro is created the same as any other macro, only when
  339. prompted for the macro name, instead hold down the AMiga key and press the
  340. key that will invoke the macro.  These one-key macros are automatically
  341. saved to the WordPerfect disk (or the hard drive directory where
  342. WordPerfect is assigned).  They can be edited and modified normally.
  343.  
  344.     To load a one-key macro into the Editor, it is necessary to load them by
  345. the correct file name, which is automatically assigned by WordPerfect at
  346. the time the macro is defined.  These macros can be found on the directory
  347. by looking at the files named {WPL}___.AMGX where X is the alpha key
  348. assigned to that macro.  For instance, {WPL}___.AMGS would be the macro
  349. invoked by holding down the AMiga key and pressing S.
  350.  
  351.     A word of caution:  once the standardized Amiga editing keys have been
  352. redefined as personalized macros, it will be necessary to re-install
  353. WordPerfect in order to again use those editing keys.  It is possible to
  354. use the unused keys for macros and still retain the AMiga editing keys. 
  355.  
  356. Philosophy of Use
  357.  
  358.     Macro Editor is designed to increase the efficiency of defined macros,
  359. not to act as an alternative means of creating them.  The only recommended
  360. way to create a WordPerfect macro is within WordPerfect!  Now, however, the
  361. Editor will allow modification and editing of the macro, once it has been
  362. created.
  363.  
  364.     When creating macros in WordPerfect, it is always best to use the
  365. keyboard command structure whenever possible rather than mouse activities. 
  366. There are a variety of situations in which mouse moves can create problems
  367. within a macro.  A classic example is that of a mouse click within a macro
  368. that addresses a precise spot on the screen.  The potential for problems
  369. lies in the fact that the macro may later be executed with different
  370. Preferences screen settings that could shift the screen a few pixels to the
  371. left or right.  Suddenly that mouse click is no longer happening on the
  372. same screen location as it was when the macro was created!
  373.  
  374.     When editing macros it is important that you be aware of the
  375. keyboard-invoked menu structure of WordPerfect.  If the macro invoked by
  376. the Amiga S key is loaded into the Editor (found in the MACS directory
  377. under the name {WPL}___>AMGS), it will show the Spell command, followed by
  378. the numeral 3 on the second command line.  If the Spell menu is entered by
  379. pressing CTRL F2, the third option listed is "3. Document".  When editing
  380. macros, it is necessary to be familiar with these menus in order to alter
  381. the activity originally defined within the macro.  Since Macro Editor can
  382. run in the background with WordPerfect, it is easy to jump back into the
  383. program to check references to menu structures whenever necessary.
  384.  
  385.     Another danger with mouse activity within a macro is a potential problem
  386. of dialogue boxes that are opened but are not visible on the screen.  When
  387. a macro is invoked only to have WordPerfect seem to lock up or freeze, it
  388. is most commonly the result of an invisible dialogue waiting for a
  389. response.  You can get out of this by hitting the RETURN key.  Sometimes it
  390. is necessary to hit either the ESCAPE key, or the Cancel key (F2) in order
  391. to return control to WordPerfect.
  392.  
  393.     The rule of thumb to use when defining macros is that if a keystroke
  394. command is available, use it instead of mouse moves.
  395.  
  396. Making Room For The Editor
  397.  
  398.     Except for those using hard drives, WordPerfect users have been fighting
  399. a disk capacity problem.  When WordPerfect moved the Print program from the
  400. program disk to the disk containing the library of printer drivers, it
  401. created a never-ending succession of disk swapping.  Now, with Macro Editor
  402. also needing a home on an already overcrowded disk, it's time to look at
  403. alternatives.
  404.  
  405.     One solution is available that will not only accommodate the needed space
  406. required by the Macro Editor, but will also curtail the annoying disk swap
  407. needed each time a data disk needs to be replaced with the Print disk prior
  408. to generating hard copy.
  409.  
  410.     By removing the WordPerfect help files from the program disk, enough
  411. space is created to comfortably accommodate both the Macro Editor and the
  412. Print routines required by WordPerfect.  The ReadMe file on the WordPerfect
  413. program disk lists the files that need to be copied from the print disk to
  414. the program disk.
  415.  
  416.     For users who are basically comfortable with WordPerfect, the sacrificing
  417. this access to the help files will more than make up for eliminatig disk
  418. swapping in order to print, and by the creation of enough disk space to
  419. handle not only the printer files and Macro Editor, but even an assortment
  420. of favorite utilities.
  421.  
  422.  
  423.